import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooMinishopDispatchStoreController } from '../../../controllers';
const uctoominishopDispatchStoreRouter = new Router();
const minishopDispatchStoreController = new uctooMinishopDispatchStoreController();

uctoominishopDispatchStoreRouter.post('/add', requireUser, minishopDispatchStoreController.add);
uctoominishopDispatchStoreRouter.post('/edit', requireUser, rowLevelPermission('uctoo/minishop_dispatch_store'), minishopDispatchStoreController.edit);
uctoominishopDispatchStoreRouter.post('/del', requireUser, rowLevelPermission('uctoo/minishop_dispatch_store'), minishopDispatchStoreController.delete);

//For getting minishopDispatchStore with permission control
uctoominishopDispatchStoreRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/minishop_dispatch_store'), minishopDispatchStoreController.getSingle);
uctoominishopDispatchStoreRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/minishop_dispatch_store'), minishopDispatchStoreController.getMany);
uctoominishopDispatchStoreRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/minishop_dispatch_store'), minishopDispatchStoreController.getMany);

//#endregion AutoCreateCode
export default uctoominishopDispatchStoreRouter;
